package com.huowenjie.entity;


import lombok.Data;

import javax.persistence.*;

@Table(name = "jpa_user")
@Entity
@Data
public class User {
    @Column(name = "id")
    @Id
    private Long id;

    @Column(name = "uname")
    private String uname;

    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "depid",referencedColumnName = "id",insertable = false,updatable =false)
    private Dept dept;
}
